

#include "MyProject.h"

extern I2C_HandleTypeDef hi2c1;

/******************************************************************************/
uint16_t I2C_getRawCount(I2C_TypeDef* I2Cx)
{
	uint32_t Timeout = 1000;
	uint8_t temp = 0;
	uint16_t res = 0;
	uint8_t d[2];
	
	temp = RAW_Angle_Hi;

	HAL_I2C_Master_Transmit(&hi2c1, AS5600_Address, &temp,1, Timeout);

	HAL_I2C_Master_Receive(&hi2c1, AS5600_Address + 1, d, 2, Timeout);

	res = (uint16_t)(d[0] << 8) + d[1];

	return res;

}
/******************************************************************************/



